---
title: "Customize Form - Actions Table"
space: "Frappe Framework"
url: "https://support.aakvatech.com/Frappe Framework/customize-form-actions-table"
updated: "2026-07-22"
---

<p>The <strong><code>actions</code></strong> table in the <strong>Customize Form</strong> Doctype allows users to define custom actions or buttons for the selected Doctype. Each row in the <strong><code>actions</code></strong> table represents a specific action and includes fields that determine its behavior and functionality. Below is a breakdown of each field in the <strong><code>actions</code></strong> table and its usage:</p>
<hr>
<h3 id="-1-label-"><strong>1. <code>label</code></strong></h3>
<ul>
<li><strong>Description:</strong> The text displayed on the action button.</li>
<li><strong>Use:</strong> Describes the purpose of the action. For example, &quot;Approve,&quot; &quot;Reject,&quot; or &quot;Send Email.&quot;</li>
</ul>
<hr>
<h3 id="-2-action_type-"><strong>2. <code>action_type</code></strong></h3>
<ul>
<li><strong>Description:</strong> Specifies the type of action to be performed.</li>
<li><strong>Use:</strong><ul>
<li>Common options include:<ul>
<li><strong>Server Script</strong>: Executes a server-side script.</li>
<li><strong>Client Script</strong>: Runs a client-side script.</li>
<li><strong>Route</strong>: Redirects to another page or view.</li>
<li><strong>Link</strong>: Opens a specific record or external link.</li>
</ul>
</li>
<li>Example: Set <code>action_type</code> to &quot;Server Script&quot; to trigger backend logic when the button is clicked.</li>
</ul>
</li>
</ul>
<hr>
<h3 id="-3-action-"><strong>3. <code>action</code></strong></h3>
<ul>
<li><strong>Description:</strong> Defines the action to be performed, such as a JavaScript function or server method.</li>
<li><strong>Use:</strong><ul>
<li>If <code>action_type</code> is &quot;Server Script,&quot; specify the method to call (e.g., <code>frappe.call</code>).</li>
<li>If <code>action_type</code> is &quot;Route,&quot; specify the route to navigate to (e.g., <code>/app/sales-invoice</code>).</li>
<li>If <code>action_type</code> is &quot;Client Script,&quot; include the JavaScript code to execute.</li>
<li>Example:<pre><code class="lang-javascript"><span class="hljs-function"><span class="hljs-keyword">function</span><span class="hljs-params">()</span> </span>{
  frappe.msgprint(<span class="hljs-string">"Action performed!"</span>);
}
</code></pre>
</li>
</ul>
</li>
</ul>
<hr>
<h3 id="-4-group-"><strong>4. <code>group</code></strong></h3>
<ul>
<li><strong>Description:</strong> Categorizes the action under a specific group.</li>
<li><strong>Use:</strong> Organize actions into logical groups in the UI. For example:<ul>
<li>Group related actions such as &quot;Send Email&quot; and &quot;Print Invoice&quot; under &quot;Communication.&quot;</li>
</ul>
</li>
</ul>
<hr>
<h3 id="-5-hidden-"><strong>5. <code>hidden</code></strong></h3>
<ul>
<li><strong>Description:</strong> Indicates whether the action should be hidden from the user interface.</li>
<li><strong>Use:</strong> Hide actions that are only intended for specific users or scenarios, or when actions are temporarily disabled.</li>
</ul>
<hr>
<h3 id="-6-idx-"><strong>6. <code>idx</code></strong></h3>
<ul>
<li><strong>Description:</strong> Sequence number of the action in the list.</li>
<li><strong>Use:</strong> Determines the display order of actions in the UI.</li>
</ul>
<hr>
<h3 id="-examples-of-usage-"><strong>Examples of Usage:</strong></h3>
<ol>
<li><p><strong>Approve Button:</strong></p>
<ul>
<li><code>label</code>: Approve</li>
<li><code>action_type</code>: Server Script</li>
<li><code>action</code>: <code>custom_app.approve_document</code></li>
<li><strong>Use:</strong> Adds an &quot;Approve&quot; button that calls a server-side function to approve the document.</li>
</ul>
</li>
<li><p><strong>Redirect to Another Doctype:</strong></p>
<ul>
<li><code>label</code>: View Related Invoices</li>
<li><code>action_type</code>: Route</li>
<li><code>action</code>: <code>/app/sales-invoice</code></li>
<li><strong>Use:</strong> Adds a button that redirects users to the Sales Invoice list view.</li>
</ul>
</li>
<li><p><strong>Trigger Client-Side Logic:</strong></p>
<ul>
<li><code>label</code>: Show Alert</li>
<li><code>action_type</code>: Client Script</li>
<li><code>action</code>: <pre><code class="lang-javascript"><span class="hljs-function"><span class="hljs-keyword">function</span><span class="hljs-params">()</span> </span>{
  frappe.msgprint(<span class="hljs-string">"This is a custom alert."</span>);
}
</code></pre>
</li>
<li><strong>Use:</strong> Adds a button that displays a custom alert when clicked.</li>
</ul>
</li>
<li><p><strong>Hidden Action for Admin Use:</strong></p>
<ul>
<li><code>label</code>: Reset Settings</li>
<li><code>action_type</code>: Server Script</li>
<li><code>action</code>: <code>custom_app.reset_settings</code></li>
<li><code>hidden</code>: Checked</li>
<li><strong>Use:</strong> Provides a backend utility accessible only to administrators.</li>
</ul>
</li>
<li><p><strong>Grouped Actions:</strong></p>
<ul>
<li><code>label</code>: Email Customer</li>
<li><code>action_type</code>: Server Script</li>
<li><code>action</code>: <code>custom_app.send_email</code></li>
<li><code>group</code>: Communication</li>
<li><strong>Use:</strong> Organize all communication-related actions under a single group.</li>
</ul>
</li>
</ol>
<hr>
<p>By using the <strong><code>actions</code></strong> table, you can add powerful custom buttons to a Doctype, enhancing its functionality and streamlining workflows. These actions can be tailored to meet specific business requirements and improve the user experience.</p>
